<template>
    <el-dialog
            title="模型信息"
            :visible.sync="modelInfoVisible"
            :close-on-click-modal="false"
            width="40%"
            v-dialogDrag>
        <div style="padding-left: 0.5%;padding-top:1%">
            <p>模型ID：{{this.infoData.artifactId}}</p>
            <p>模型名称：{{this.infoData.name}}</p>
            <p>所属课题组：{{this.infoData.groupId}}</p>
            <p>模型描述：{{this.infoData.description}}</p>
            <p>算法描述：{{this.infoData.algo}}</p>
            <p>模型用途：{{this.infoData.usage}}</p>
            <p>运行主类：{{this.infoData.mianClass}}</p>
            <p>程序类型：{{this.infoData.frameworkType}}</p>
            <p>模型关键字：{{this.infoData.keywords}}</p>
            <p>模型依赖包:{{this.infoData.packages}}</p>
            <p>日期：{{this.infoData.date}}</p>
            <p>模型版本：{{this.infoData.versionId}}</p>
            <p>作者：{{this.infoData.authorId}}</p>
            <p>联系作者：{{this.infoData.email}}</p>
        </div>
    </el-dialog>
</template>

<script>
    export default {
        name: "modelInfoDialog",
        data() {
            return {
                modelInfoVisible: false,
                url: '',
                infoData:{},
            }
        },
        methods: {
            getModelInfo() {
                let that = this;
                this.infoData = {};
                this.$axios.get(that.url).then(res => {
                    that.infoData = res.data.body;
                }).catch(function (error) {
                    console.log(error);
                    that.$message({
                        type: 'warning',
                        message: '模型信息获取失败！'
                    })
                })
            }
        },
        created() {
            let that = this;
            this.$Bus.$on('modelInfo', res => {
                that.url = res.url;
                that.modelInfoVisible = res.visible;
                that.getModelInfo();
            })
        }
    }
</script>

<style>
    .el-dialog__body{
        max-height: 600px;
        overflow: auto;
    }
</style>